package com.myshop.b2b.commonmodule;

/**
 * @author likaiping
 * @createTime 2024/7/2 16:59
 */

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

/**
 *
 * @TableName goods
 */
@TableName(value ="goods")
public class Goods implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer gid;

    /**
     * 商品名称
     */
    private String gname;

    /**
     * 商品图片地址
     */
    private String gremain;

    /**
     * 商品介绍
     */
    private String gdetails;

    /**
     * 商品价格
     */
    private Integer gprice;

    /**
     * 商品类别
     */
    private Integer types;

    /**
     * 商品库存
     */
    private Integer stock;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    public Integer getGid() {
        return gid;
    }

    /**
     * 主键
     */
    public void setGid(Integer gid) {
        this.gid = gid;
    }

    /**
     * 商品图片地址
     */
    public String getGremain() {
        return gremain;
    }

    /**
     * 商品图片地址
     */
    public void setGremain(String gremain) {
        this.gremain = gremain;
    }

    /**
     * 商品价格
     */
    public Integer getGprice() {
        return gprice;
    }

    /**
     * 商品价格
     */
    public void setGprice(Integer gprice) {
        this.gprice = gprice;
    }

    /**
     * 商品类别
     */
    public Integer getTypes() {
        return types;
    }

    /**
     * 商品类别
     */
    public void setTypes(Integer types) {
        this.types = types;
    }

    /**
     * 商品名称
     */
    public String getGname() {
        return gname;
    }

    /**
     * 商品名称
     */
    public void setGname(String gname) {
        this.gname = gname;
    }

    /**
     * 商品介绍
     */
    public String getGdetails() {
        return gdetails;
    }

    /**
     * 商品介绍
     */
    public void setGdetails(String gdetails) {
        this.gdetails = gdetails;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Goods other = (Goods) that;
        return (this.getGid() == null ? other.getGid() == null : this.getGid().equals(other.getGid()))
                && (this.getGremain() == null ? other.getGremain() == null : this.getGremain().equals(other.getGremain()))
                && (this.getGprice() == null ? other.getGprice() == null : this.getGprice().equals(other.getGprice()))
                && (this.getTypes() == null ? other.getTypes() == null : this.getTypes().equals(other.getTypes()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getGid() == null) ? 0 : getGid().hashCode());
        result = prime * result + ((getGremain() == null) ? 0 : getGremain().hashCode());
        result = prime * result + ((getGprice() == null) ? 0 : getGprice().hashCode());
        result = prime * result + ((getTypes() == null) ? 0 : getTypes().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", gid=").append(gid);
        sb.append(", gremain=").append(gremain);
        sb.append(", gprice=").append(gprice);
        sb.append(", types=").append(types);
        sb.append(", gname=").append(gname);
        sb.append(", gdetails=").append(gdetails);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
